def classify_keywords(input_list):

     # 可以用以下2个excel函数，在excel提前进行单元格内容合并
     # 比如把 'a1'到 'z1'合并，之后写进字典中
     # =TEXTJOIN(",",TRUE,A1:Z1)
     # =SUBSTITUTE(CONCAT(A1:Z1&","),",,",",")

    # 字典
    category_map = {
        'metal': {'a1', 'a2', 'a3'},
        'edge': {'a4', 'a5'},
        'kill': {'b1', 'b2', 'b3', 'b4'}
    }

    # 反向映射字典
    reverse_map = {}
    for category, keywords in category_map.items():
        for kw in keywords:
            reverse_map[kw] = category

    result = []
    for kw in input_list:
        if kw in reverse_map:
            result.append(reverse_map[kw])
    return result


user_input = [kw.strip() for kw in input("请输入关键词（多个用逗号分隔）: ").split(',') if kw.strip()]
print(classify_keywords(user_input))